<template>
	<view>
			<view class="aff_head"><!-- <text style="color: red;">*</text> -->{{title}}</view>
			<view class="fllow_item">
				<view class="item_content">
					<view class="con_img">
						<view class="main_first">
							<view class="main_title">
								<view class="first_left">
									<view>订单日期：{{orderdetail.addTime ||''}}</view>
								</view> 
							</view>
							<view class="main_title">
								<view class="first_left">
									<view class="fontColor">订单金额：{{orderdetail.totalPrice}}</view>
									<view class="fontColor" v-if="orderdetail.orderArrears > 0">{{orderdetail.orderArrears}}</view>
								</view> 
							</view>
							<view class="main_title" v-if="orderdetail.pay_desc">
								<view class="first_left">
									<view class="fontColor">支付方式：{{orderdetail.pay_desc||''}}</view>
								</view> 
							</view>
							<view class="main_title">
								<view class="first_left">
									<view class="fontColor">消费信息：{{orderdetail.order_consume_info||''}}</view>
								</view> 
							</view>
							
							<view class="main_title"  v-if="orderdetail.staffArchiveLog">
								<view class="first_left">
									<view class="fontColor">销售业绩：<span class="layui-row" v-for="item in orderdetail.staffArchiveLog.sale">{{item.staff?item.staff.trueName:'已删除员工'}}  {{item.salesAmount}}元(预计提成{{item.project_unit}})</span></view>
								</view> 
							</view>
							<view class="main_title"  v-if="orderdetail.staffArchiveLog">
								<view class="first_left">
									<view class="fontColor">耗卡业绩：<span class="layui-row" v-for="item in orderdetail.staffArchiveLog.consume">{{item.staff?item.staff.trueName:'已删除员工'}}  {{item.project_consume}}元(手工{{item.manual}})</span></view>
								</view> 
							</view>
						</view>
					</view> 
				</view> 
				<view class="bottomli">
					<view class="sure btn" @click="audit(orderdetail.id, 1)">通过</view><view class="remove btn" @click="audit(orderdetail.id, -1)">拒绝</view>
					<view class=" btn" @click="xiugai">修改</view>
				</view>
			</view>
	</view>
</template>

<script>
	import { BASE_IMG_URL } from '@/util/api.js'
	import {
		netOrderDetail,
		netOrderAudit
	} from '@/api/main.js'
	export default{
		props:{  
			title:{
				type:String,
				default:'订单审核'
			}
		},
		data() {
			return{
				BASE_IMG_URL:BASE_IMG_URL,
				orderdetail: {
					
				}
			}
		},  
		methods: {
			getOrder(checkedOfid) {
				let params = {
					id: checkedOfid
				}
				netOrderDetail(params).then(res => {
					res = res.data 
					this.orderdetail = res
				})
			},
			audit: function (id, type){
			 	 
			 	let params = {
			 		ofid: id,
			 		status: type
			 	}
			 	netOrderAudit(params).then(res => {
			 		uni.showToast({
			 			title: "操作成功",
			 			icon: "none",
			 			duration: 1000
			 		})
			 		
			 		this.$emit('onaudited', params)
			 	}) 
			    },
			delCashierStaff(index) {
				this.$emit('delCashierStaff',index)
			},
		}
	}
</script>

<style lang="scss">
	.bottom_nav {
		position: fixed;
		bottom: 0;
		left: 0;
		right: 0;
		padding: 20rpx 24rpx;
		background-color: #fff;
		text-align: center;
		color: #999;
		display: flex;
		justify-content: space-around;
		align-items: center;
		box-sizing: border-box;
		z-index: 2;
		.bottom_item {
			width:380rpx;
			height:80rpx;
			border-radius: 40rpx;
			text-align: center;
			line-height: 80rpx;
			background:#03aa96;
			color:#fff;
			font-size:26rpx;
		}
		.bott_text{
			font-size:24rpx;
			color:#03aa96;
			span{
				color:#666;
			}
		}
	} 
	.new_fllow {
		margin-top: 40rpx;
		font-size: 28rpx;

		.fllow_form {
			display: flex;
			justify-content: space-between;
			height: 100rpx;
			line-height: 100rpx;
			background-color: #fff;
			border-bottom: 1rpx solid #EAEAEA;
			padding: 0 24rpx;

			.form_right {
				display: flex;
				color: #999;

				image {
					width: 40rpx;
					height: 40rpx;
					margin: 28rpx 5rpx 0 0;
				}
			}

			text {
				color: #f00;
				margin-left: 10rpx;
			}

			.form_input {
				input {
					height: 92%;
					// line-height: 100rpx;
					text-align: right;
					margin-right: 10rpx;
				}
			}

			.fllow_button {
				margin-top: 15rpx;
			}
		}

		.fllow_file_li {
			padding: 24rpx 34rpx;
			background: #fff;
			border-bottom: 1rpx solid #EAEAEA;

			.fil_li {
				display: flex;
				justify-content: space-between;
				align-items: center;
				margin-bottom: 14rpx;

				.fileimg {
					width: 20rpx;
					height: 20rpx;
				}

				.filename {
					font-size: 24rpx;
					color: #999999;
				}

				.closeimg {
					width: 32rpx;
					height: 32rpx;
				}
			}
		}

		.imglist {
			padding: 24rpx 34rpx;
			background: #fff;
			border-bottom: 1rpx solid #EAEAEA;
			display: flex;
			justify-content: flex-start;
			align-items: center;
			flex-wrap: wrap;

			.imgbox {
				width: 160rpx;
				height: 160rpx;
				margin-right: 14rpx;
				position: relative;
				margin-bottom: 24rpx;
				border: 1rpx solid #EAEAEA;

				.delimg {
					width: 32rpx;
					height: 32rpx;
					border-radius: 50%;
					position: absolute;
					right: -16rpx;
					top: -16rpx;
					background: rgba(0, 0, 0, 0.5);
					z-index: 2;
				}

				.selfimg {
					width: 160rpx;
					height: 160rpx;
				}
			}
		}

		.fllow_area {
			background-color: #fff;
			// padding: 0 70rpx;
			margin-bottom: 30rpx;
			padding-bottom: 30rpx;
			color: #999;

			.area_head {
				height: 100rpx;
				line-height: 100rpx;
				font-size: 32rpx;
				padding: 0 70rpx;

				text {
					color: #f00;
				}
			}

			textarea {
				width: 80%;
				height: 300rpx;
				padding: 30rpx;
				background: #f8f8f8;
				margin: 0 auto;
			}
		}

		.info_head {
			height: 80rpx;
			line-height: 80rpx;
			font-size: 24rpx;
			color: #999;
			padding-left: 24rpx;
		}

		.affiliation {
			background-color: #fff;
			margin-bottom: 20rpx;
			padding-bottom: 40rpx;

			.aff_head {
				height: 100rpx;
				line-height: 100rpx;
				padding-left: 30rpx;

				text {
					color: #f00;
					margin-left: 10rpx;
				}
			}

			.aff_con {
				display: flex;
				text-align: center;
				flex-wrap: wrap;

				.aff_item {
					width: 100rpx;
					margin-right: 15rpx;
					border-radius: 50%;
					margin-bottom: 15rpx;

					image {
						margin-bottom: 15rpx;
						width: 60rpx;
						height: 60rpx;

					}
				}

				.affbox {
					position: relative;

					.delremind {
						width: 32rpx;
						height: 32rpx;
						border-radius: 50%;
						position: absolute;
						right: -16rpx;
						top: -16rpx;
						background: rgba(0, 0, 0, 0.5);
						z-index: 2;
					}
				}

				.aff_last {
					image {
						margin-bottom: 15rpx;
						width: 48rpx;
						height: 48rpx;
					}
				}
			}
		}

		.follow_task {
			height: 80rpx;
			line-height: 80rpx;
		}
	}

	#btn {
		font-size: 26rpx;
		color: #fff;
		text-align: center;
		line-height: 88rpx;
		width: 500rpx;
		height: 88rpx;
		background: #03AA96;
		border-radius: 29rpx;
		margin: 30rpx auto;
	}
	
	
	.fllow_item {
		position: relative;
		.unread{
			width:10rpx;
			height:10rpx;
			border-radius: 50%;
			position: absolute;
			right:5rpx;
			top:5rpx;
			background:#F43F3B;
		}
		.item_data {
			margin: 30rpx 0;
	
			&::before {
				content: '';
				display: inline-block;
				margin: 0 15rpx 0 24rpx;
				width: 20rpx;
				height: 20rpx;
				border-radius: 10rpx;
				border: 2rpx solid #03aa96;
			}
		}
	
		.item_content {
			display: block;
			background-color: #fff;
			padding: 24rpx 24rpx; 
			border-radius: 10rpx;
			margin-bottom: 30rpx;
	
			.con_img {
				display: flex;
				.main_first {
					margin-bottom: 25rpx;
					padding-left: 25rpx;
					flex: 1;
					.main_time{
						line-height: 25px;
					}
					.main_title{
						display: flex;
						width: 100%;
						justify-content: space-between;
						.first_left {
							display: flex;
						
							:first-child {
								font-size: 32rpx;
								margin-right: 10rpx;
								margin-top: -3rpx;
							}
						
							:last-child {
								margin-top: 2rpx;
							}
						}
						.main_type{
							padding:5rpx 20rpx;
							border-radius: 10rpx;
							color:#fff;
						}
						.daofang{
							background:#03aa96;
						}
						.genjin{
							background:#ff7800;
						}
						.other{
							background:#1CBBB4;
						}
					}
					
				}
				image {
					width: 100rpx;
					height: 100rpx;
					border-radius: 50%;
				}
			}
	
			.con_main {
				flex: 1;
				.main_second{
					padding-bottom:20rpx;
				}
				
				.main_img{
					display: flex;
					justify-content: flex-start;
					align-items: center;
					flex-wrap: wrap;
					margin-top: 20rpx;
					.imgbox{
						padding: 10rpx;
						border-radius: 5rpx;
						border:1rpx solid #CCCCCC;
						width:160rpx;
						height:160rpx;
						margin-right:14rpx;
						margin-bottom:14rpx;
					}
				}
				.main_third {
					display: flex;
					justify-content: space-between;
					align-items: center;
					margin: 20rpx 0 10rpx;
	
					.third_left {
						display: flex;
						align-items: center;
						.icon-clock{
							font-size:32rpx;
						}
						.lxs_time{
							margin-left: 5px;
							font-size:26rpx;
						}
					}
					.third_right {
						display: flex;
						.right_num {
							display: flex;
							:last-child {
								margin-right: 20rpx;
							}
						}
	
						.icon-arrows_right {
							margin-top: -4rpx;
						}
					}
				}
	
				.main_fourth {
					padding-bottom: 10rpx;
				}
			}
		}
	}
	
	
	.bottomli { 
		width: 750rpx;
		height: 120rpx;
		display: flex;
		justify-content: space-around;
		align-items: center;
		background: #fff;
		border-top: 1rpx solid #EAEAEA;
	
		.btn {
			width: 300rpx;
			height: 80rpx;
			font-size: 24rpx;
			color: #666666;
			text-align: center;
			line-height: 80rpx;
			border-radius: 40rpx;
		}
	
		.sure {
			background: #03aa96;
			color: #fff;
		}
	
		.remove {
			border: 1rpx solid #03aa96;
			color: #03aa96;
			line-height: 78rpx;
		}
	}
</style>
